#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wsgiref.handlers
import os
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from src import  action
class MainPage(webapp.RequestHandler):
    def go(self,values,path1,path2='../template'):
        #print '------------------------'
        path = os.path.join(os.path.dirname(__file__), path2, path1)
        #print path
        self.response.out.write(template.render(path, values))
    def get(self):
        #print self.request.cookies.get('name')  
        self.go(None,'msg.htm') 

application = webapp.WSGIApplication([
  ('/', action.Login),
  ('/indexYo', MainPage),
  ('/login',action.Login),
  
  #消息处理
  ('/msg',action.Msg),
  ('/addMsg',action.AddMsg)
], debug=True)

def main():
    wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
    main()
